﻿<UserControl
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
			 xmlns:local="clr-namespace:OMANE.Modules.PMT" 
			 xmlns:d="http://schemas.microsoft.com/expression/blend/2008" mc:Ignorable="d" 
			 x:Class="ViewPMT">
    <UserControl.Resources>
        <local:TableStateToIconConverter x:Key="TableState  ToIconConverter" />
        <DataTemplate DataType="{x:Type local:ViewModelFichierPMT}">
            <local:ViewGenTbleFluxPMT/>
        </DataTemplate>
        <Style x:Key="ListBoxItemStyleTblesFlux" TargetType="{x:Type ListBoxItem}">
        	<Setter Property="Background" Value="Transparent"/>
        	<Setter Property="HorizontalContentAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
        	<Setter Property="VerticalContentAlignment" Value="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
        	<Setter Property="Padding" Value="2,0,0,0"/>
        	<Setter Property="Template">
        		<Setter.Value>
        			<ControlTemplate TargetType="{x:Type ListBoxItem}">
        				<Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true">
        					<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
        				</Border>
        			</ControlTemplate>
        		</Setter.Value>
        	</Setter>
        </Style>
    </UserControl.Resources>
	<d:UserControl.DataContext>
		<local:ViewModelPMT/>
	</d:UserControl.DataContext>
    <Grid Margin="0,10">
    	<Grid.RowDefinitions>
    		<RowDefinition Height="Auto"/>
    		<RowDefinition Height="Auto"/>
    		<RowDefinition Height="Auto"/>
    		<RowDefinition Height="Auto"/>
    	</Grid.RowDefinitions>
    	<Grid.ColumnDefinitions>
    		<ColumnDefinition Width="Auto"/>
    		<ColumnDefinition/>
    	</Grid.ColumnDefinitions>
        <Border BorderThickness="0" Margin="0" Grid.ColumnSpan="2" BorderBrush="{DynamicResource BrushCouleur1Base}">
    		<Grid Margin="10,0,10,10">
    			<Grid.RowDefinitions>
    				<RowDefinition/>
    				<RowDefinition/>
    				<RowDefinition/>
    			</Grid.RowDefinitions>
    			<Grid.ColumnDefinitions>
    				<ColumnDefinition Width="Auto"/>
    				<ColumnDefinition/>
    			</Grid.ColumnDefinitions>
    			<TextBlock TextWrapping="Wrap" Text="Mois et Année du PMT" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0,2"/>
    			<TextBlock TextWrapping="Wrap" Text="{Binding AnneeMoisPMT, Mode=OneWay}" HorizontalAlignment="Left" VerticalAlignment="Top" Grid.Column="1" Margin="10,2,0,2" FontWeight="Normal"/>
    			<TextBlock TextWrapping="Wrap" Text="Racine des paramètres" HorizontalAlignment="Left" VerticalAlignment="Top" Grid.Row="1" Margin="0,2"/>
    			<TextBlock TextWrapping="Wrap" Text="{Binding RacineParametres, Mode=OneWay}" HorizontalAlignment="Left" VerticalAlignment="Top" Grid.Row="1" Grid.Column="1" Margin="10,2,0,2" FontWeight="Normal"/>
    			<TextBlock TextWrapping="Wrap" Text="Racine de l'infocentre" HorizontalAlignment="Left" VerticalAlignment="Center" Grid.Row="2" Margin="0,2"/>
    			<TextBlock TextWrapping="Wrap" Text="{Binding RacineInfocentre, Mode=OneWay}" Grid.Row="2" HorizontalAlignment="Left" VerticalAlignment="Center" d:LayoutOverrides="GridBox" Grid.Column="1" Margin="10,2,0,2" FontWeight="Normal"/>
    		</Grid>
    	</Border>
    	<Border BorderBrush="{DynamicResource BrushCouleur1Base}" BorderThickness="1" Grid.Row="1" Grid.ColumnSpan="2" Margin="10,0,10,10">
    		<Grid>
    			<Grid.ColumnDefinitions>
    				<ColumnDefinition Width="Auto"/>
    				<ColumnDefinition/>
    			</Grid.ColumnDefinitions>
    			<Grid.RowDefinitions>
    				<RowDefinition/>
    				<RowDefinition Height="Auto"/>
    			</Grid.RowDefinitions>
    			<Button Content="Etape 1" Margin="10,10,0,10" FontWeight="Normal" HorizontalAlignment="Left" Grid.RowSpan="2"/>
    			<StackPanel HorizontalAlignment="Left" Orientation="Horizontal" Margin="0,10,0,0" Grid.Column="1">
    				<GroupBox Header="Configuration" HorizontalAlignment="Left" Margin="10,0,0,0">
    					<Grid Margin="5,5,5,0" d:LayoutOverrides="Width">
    						<Grid.RowDefinitions>
    							<RowDefinition Height="Auto" MinHeight="25"/>
    							<RowDefinition Height="Auto" MinHeight="25"/>
    							<RowDefinition Height="Auto" MinHeight="25"/>
    							<RowDefinition Height="Auto" MinHeight="25"/>
    							<RowDefinition Height="Auto" MinHeight="25"/>
    						</Grid.RowDefinitions>
    						<Grid.ColumnDefinitions>
    							<ColumnDefinition Width="Auto"/>
    							<ColumnDefinition Width="Auto"/>
    						</Grid.ColumnDefinitions>

                            <TextBlock FontWeight="Normal"  TextWrapping="Wrap" Text="Mois dernier arrêté :" HorizontalAlignment="Left" VerticalAlignment="Center" d:LayoutOverrides="HorizontalAlignment" Margin="0,2,5,2" />
                            <ComboBox Grid.Column="1" VerticalAlignment="Center" ItemsSource="{Binding ListeMoisDernierArrete}" SelectedItem="{Binding CurrentMoisDernierArrete}" FontWeight="Normal" Width="60" Margin="0,0,-0.001,0" d:LayoutOverrides="HorizontalMargin"/>
                            <TextBlock FontWeight="Normal" Grid.Row="1" TextWrapping="Wrap" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="0,2,5,2" Text="Année dernier arrêté :"/>
                            <ComboBox Grid.Column="1" Grid.Row="1" VerticalAlignment="Center" ItemsSource="{Binding ListeAnneeDernierArrete}" SelectedItem="{Binding CurrentAnneeDernierArrete}" FontWeight="Normal" Width="60"/>
                            <TextBlock FontWeight="Normal" TextWrapping="Wrap" Text="Nombre d'années de projection :" HorizontalAlignment="Left" VerticalAlignment="Center" Grid.Row="2" Margin="0,2,5,2" />
                            <ComboBox Grid.Column="1" Grid.Row="2" VerticalAlignment="Center" ItemsSource="{Binding ListNbAnneesProj}" SelectedItem="{Binding CurrentNbAnneesProj}" FontWeight="Normal" Width="60"/>
    					</Grid>
    				</GroupBox>
    				<GroupBox d:LayoutOverrides="GridBox" HorizontalAlignment="Left" Margin="10,0,0,0" Header="Les tables du flux">
    					<ListBox HorizontalContentAlignment="Right" FontWeight="Normal" ItemContainerStyle="{DynamicResource ListBoxItemStyleTblesFlux}" BorderThickness="0" Background="Transparent" Margin="5" ItemsSource="{Binding ListeVMTablesFlux}"/>
    				</GroupBox>
    			</StackPanel>
                <Button Content="Test Serialization" HorizontalAlignment="Left" Grid.Row="1" VerticalAlignment="Top" Grid.Column="1" Margin="10,10,0,10" FontWeight="Normal" Command="{Binding SerializerAction, Mode=OneWay}"/>
    		</Grid>
    	</Border>
    	<Border BorderThickness="1" Grid.Row="2" Grid.ColumnSpan="2" Margin="10,0" Visibility="{Binding IsEtape1Finished, Mode=OneWay}">
    		<Border.BorderBrush>
    			<SolidColorBrush Color="{DynamicResource Couleur1Base}"/>
    		</Border.BorderBrush>
    		<Grid Margin="0,10">
    			<Grid.RowDefinitions>
    				<RowDefinition/>
    				<RowDefinition/>
    			</Grid.RowDefinitions>
    			<Grid.ColumnDefinitions>
    				<ColumnDefinition Width="Auto"/>
    				<ColumnDefinition/>
    			</Grid.ColumnDefinitions>
                <Button Content="Etape 2" RenderTransformOrigin="0.5,0.5" HorizontalAlignment="Left" d:LayoutOverrides="HorizontalAlignment" Grid.RowSpan="2" FontWeight="Normal" Margin="10,0,0,0"/>
    			<StackPanel Orientation="Horizontal" d:LayoutOverrides="Width" Grid.Column="1" Margin="10,0,0,0">
                    <GroupBox Header="Tables administrateur" d:LayoutOverrides="Width" Margin="0,0,0,10" ScrollViewer.VerticalScrollBarVisibility="Disabled">
                    	<ListBox Background="{x:Null}" ItemsSource="{Binding ListeVMTablesParam}" HorizontalContentAlignment="Right" ScrollViewer.VerticalScrollBarVisibility="Auto" BorderThickness="0" Margin="5" FontWeight="Normal" ItemContainerStyle="{DynamicResource ListBoxItemStyleTblesFlux}"/>
                    </GroupBox>
                    <GroupBox Header="Tables actuarielles" d:LayoutOverrides="Width" Margin="10,0,0,10" >
                    	<ListBox Background="{x:Null}" FontWeight="Normal" ItemContainerStyle="{DynamicResource ListBoxItemStyleTblesFlux}" BorderThickness="0" ItemsSource="{Binding ListeVMTablesActuarielles}" HorizontalContentAlignment="Right" Margin="5"/>
                    </GroupBox>
    			</StackPanel>
                <Button Content="Générer les fichiers de périmètre" HorizontalAlignment="Left" Grid.Row="1" VerticalAlignment="Top" Grid.Column="1" Margin="10,0,0,0" FontWeight="Normal"/>
    		</Grid>
    	</Border>
    	<Border BorderThickness="1" Grid.Row="3" Margin="10,0" Visibility="{Binding IsEtape1Finished, Mode=OneWay}" d:LayoutOverrides="GridBox" Grid.ColumnSpan="2">
    		<Border.BorderBrush>
    			<SolidColorBrush Color="{DynamicResource Couleur1Base}"/>
    		</Border.BorderBrush>
    		<Grid Margin="0,10">
    			<Grid.RowDefinitions>
    				<RowDefinition/>
    				<RowDefinition/>
    			</Grid.RowDefinitions>
    			<Grid.ColumnDefinitions>
    				<ColumnDefinition Width="Auto"/>
    				<ColumnDefinition/>
    			</Grid.ColumnDefinitions>
    			<Button Content="Etape 3" RenderTransformOrigin="0.5,0.5" HorizontalAlignment="Left" d:LayoutOverrides="HorizontalAlignment" Grid.RowSpan="2" FontWeight="Normal" Margin="10,0,0,0"/>
    			<StackPanel Orientation="Horizontal" d:LayoutOverrides="Width" Grid.Column="1" Margin="10,0,0,0">
    				<GroupBox Header="Les fichiers de périmètre" d:LayoutOverrides="Width" Margin="0,0,0,10" ScrollViewer.VerticalScrollBarVisibility="Disabled">
    					<ListBox Background="{x:Null}" ItemsSource="{Binding ListeVMTablesParam}" HorizontalContentAlignment="Right" ScrollViewer.VerticalScrollBarVisibility="Auto" BorderThickness="0" Margin="5" FontWeight="Normal" ItemContainerStyle="{DynamicResource ListBoxItemStyleTblesFlux}"/>
    				</GroupBox>
    				<GroupBox Header="Tables actuarielles" d:LayoutOverrides="Width" Margin="10,0,0,10" >
    					<ListBox Background="{x:Null}" FontWeight="Normal" ItemContainerStyle="{DynamicResource ListBoxItemStyleTblesFlux}" BorderThickness="0" ItemsSource="{Binding ListeVMTablesActuarielles}" HorizontalContentAlignment="Right" Margin="5"/>
    				</GroupBox>
    			</StackPanel>
    			<Button Content="Button" HorizontalAlignment="Left" Grid.Row="1" VerticalAlignment="Top" Width="75" Grid.Column="1" Margin="10,0,0,0" FontWeight="Normal"/>
    		</Grid>
    	</Border>
            
    </Grid>
</UserControl>
